package com.sgcc.nfc.lock.di

import com.sgcc.nfc.lock.core.util.DefaultDispatcher
import com.sgcc.nfc.lock.core.util.DispatcherProvider
import com.sgcc.nfc.lock.core.util.IoDispatcher
import com.sgcc.nfc.lock.core.util.MainDispatcher
import dagger.Module
import dagger.Provides
import dagger.hilt.InstallIn
import dagger.hilt.components.SingletonComponent
import kotlinx.coroutines.CoroutineDispatcher

@Module
@InstallIn(SingletonComponent::class)
object DispatcherModule {
    @Provides
    @IoDispatcher
    fun provideIoDispatcher(): CoroutineDispatcher = DispatcherProvider.io

    @Provides
    @MainDispatcher
    fun provideMainDispatcher(): CoroutineDispatcher = DispatcherProvider.main

    @Provides
    @DefaultDispatcher
    fun provideDefaultDispatcher(): CoroutineDispatcher = DispatcherProvider.default
}
